﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ccit.ClassLibrary;

namespace Ccit.Utils
{
    /// <summary>
    /// Description: 自定义消息对象MsKeyValue 比较器 
    /// Author: tim 2010-02-01
    /// </summary>
    public class KeyValComparer : IEqualityComparer<MsKeyValue>
    {
        #region IEqualityComparer<MsKeyValue> 成员

        public bool Equals(MsKeyValue x, MsKeyValue y)
        {
            if ((null == x) || (null == y)) return false;

            if (x.key == y.key)
                return true;

            return false;
        }

        public int GetHashCode(MsKeyValue obj)
        {
            return obj.ToString().GetHashCode();
        }

        #endregion
    }
}
